class CreateRoles < ActiveRecord::Migration
  def self.up
    create_table :roles do |t|
      t.string  :name          ,:null => false  ,:limit => 50    #名称
      t.string  :description                                     #写一些备注之类的信息
      t.integer :is_locked     ,:limit => 1 ,:default => 1       #锁定 1为True 0为False
      t.integer :lock_version  ,:default => 0                    #乐观锁
      t.timestamps
    end
  end

  def self.down
    drop_table :roles
  end
end
